<template>
	<view class="Card">
		<view class="membershipCard">
			<view class="header">
				<image :src="$IMG_URL('/static/newVersion/vip1.png')" mode="aspectFill" class="logo"></image>
				<view class="center">
					<image :src="$IMG_URL('/static/user/memberSize.png')" mode="aspectFilla" class="memberSize"></image>
				</view>
				<view class="right">
					<view class="car_R">
						<view :class="userQuery.state == 'effect'?'color1':userQuery.state == 'past'?'color2':'color3'">
							{{userQuery.state_str}}
						</view>
				
						<view v-if="userQuery.stop_card_btn_str" :class="[
						    'base-stop-card', 
						   
						    userQuery.use_stop_card === 'no_use' ? 'stop1-card-btn' : 'stop2-card-btn'  
						  ]" @click.stop="handleStopClick">
							{{ userQuery.stop_card_btn_str }}
						</view>
					</view>
					<u-icon name="arrow-right" color="#43332b" size="14" class="ml" v-if="iconShow"></u-icon>
				</view>

			</view>
			<view class="bottom">
				<view class="size1">
					{{userQuery.title}}
				</view>
				<view class="size2">
					有效期限：{{userQuery.date_str}}
				</view>
				<view class="size2">
					添加日期：{{userQuery.add_date}}
				</view>

			</view>
		</view>

	</view>
</template>

<script>
	export default {
		props: {
			userQuery: {
				type: Object,
				default: {},
				required: true
			},
			iconShow: {
				type: Boolean,
				default: false,
				required: true
			},
			// isStop1: {
			// 	type: Boolean,
			// 	default: true,
			// 	required: true
			// },
			isType: {
				type: String,
				default: '',
				required: false
			}
		},
		data() {
			return {
				member1:'url(https://ugeego.youjixiaoyang.com/member/hg.png)',
				member2:'url(https://ugeego.youjixiaoyang.com/member/vip.png)'
			}
		},
		methods: {
			handleStopClick(e) {
				//当会员卡状态是已使用时不能出现弹窗
		
				this.$emit('stopClick', this.userQuery);
			}
		}
	}
</script>

<style lang="scss" scoped>
	.Card {
		width: 750rpx;
		padding: 0 24rpx;
		margin-top: 20rpx;
		// position: absolute;
	}

	.car-R {
		display: flex;

	}

	.base-stop-card {
		width: 180rpx;
		height: 36rpx;
		font-size: 22rpx;
		text-align: center;
		line-height: 36rpx;
		margin-top: 4rpx;
		border-radius: 8rpx;
	}

	.stop1-card-btn {
		background: rgb(115, 240, 234);
		color: #333;
	}

	.stop2-card-btn {
		width: 160rpx;
		border: 1rpx solid #999999;
		color: #999999;
	}


	.membershipCard {
		width: 702rpx;
		height: 280rpx;
		background-image: url(https://ugeego.youjixiaoyang.com/static/member/memberbg.png);
		background-repeat: no-repeat no-repeat;
		background-size: cover;
		display: flex;
		flex-direction: column;


		.header {
			width: 100%;
			height: 90rpx;
			padding: 0 18rpx 0 36rpx;
			display: flex;
			flex-direction: row;
			align-items: center;

			.logo {
				width: 48rpx;
				height: 48rpx;
				margin-right: 12rpx;
			}

			.center {
				display: flex;
				flex-direction: row;
				align-items: center;
				flex: 1;

				.memberSize {
					width: 302rpx;
					height: 46rpx;
				}
			}

			.right {
				display: flex;
				flex-direction: row;
				align-items: center;

				.ml {
					margin-left: 12rpx;
				}

				.color1 {
					font-size: 28rpx;
					font-family: PingFang SC, PingFang SC-Bold;
					font-weight: 700;
					text-align: right;
					color: #48b0a9;
				}

				.color2 {
					font-size: 28rpx;
					font-family: PingFang SC, PingFang SC-Bold;
					font-weight: 700;
					text-align: right;
					color: #999999;
				}

				.color3 {
					font-size: 28rpx;
					font-family: PingFang SC, PingFang SC-Bold;
					font-weight: 700;
					text-align: right;
					color: #ee8e3a;
				}
			}
		}

		.bottom {
			width: 100%;
			height: 117rpx;
			display: flex;
			flex-direction: column;
			padding: 34rpx 0 0 34rpx;

			.size1 {
				opacity: 0.6;
				font-size: 28rpx;
				font-family: PingFang SC, PingFang SC-Bold;
				font-weight: 700;
				text-align: left;
				color: #000000;
				margin-bottom: 12rpx;
			}

			.size2 {
				opacity: 0.4;
				font-size: 24rpx;
				font-family: PingFang SC, PingFang SC-Medium;
				font-weight: 500;
				text-align: left;
				color: #000000;
			}
		}
	}
</style>